//
//  WmcLifeCycleDelegate.swift
//  YPWatermarkCamera
//
//  Created by 赵新 on 2022/4/15.
//

import UIKit

// MARK: - [WmcViewControllerDelegate]

/// 页面生命周期代理
public protocol WmcViewControllerDelegate: NSObjectProtocol {
    /// 某个页面准备出现
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - navigationPath: 路由键值组
    func viewWillAppear(_ attribute: WmcAttribute,
                        navigationPath: [WmcNavigatorManager.Path]?)
    /// 某个页面完全出现
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - navigationPath: 路由键值组
    func viewDidAppear(_ attribute: WmcAttribute,
                       navigationPath: [WmcNavigatorManager.Path]?)
    /// 某个页面即将消失
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - navigationPath: 路由键值组
    func viewWillDisappear(_ attribute: WmcAttribute,
                           navigationPath: [WmcNavigatorManager.Path]?)
    /// 某个页面已经消失
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - navigationPath: 路由键值组
    func viewDidDisappear(_ attribute: WmcAttribute,
                          navigationPath: [WmcNavigatorManager.Path]?)

    /// 页面开始加载视图
    /// - Parameters:
    ///   - attribute: 当前水印相机的属性
    ///   - navigationPath: 路由键值组
    func viewDidLoad(_ attribute: WmcAttribute,
                     navigationPath: [WmcNavigatorManager.Path]?)
}

// MARK: - =========================⚠️以下对接业务方无需查看或了解⚠️=========================

public extension WmcViewControllerDelegate {
    /// 某个页面准备出现
    func viewWillAppear(_ attribute: WmcAttribute,
                        navigationPath: [WmcNavigatorManager.Path]?) {}
    
    /// 某个页面完全出现
    func viewDidAppear(_ attribute: WmcAttribute,
                       navigationPath: [WmcNavigatorManager.Path]?) {}
    
    /// 某个页面即将消失
    func viewWillDisappear(_ attribute: WmcAttribute,
                           navigationPath: [WmcNavigatorManager.Path]?) {}
    
    /// 某个页面已经消失
    func viewDidDisappear(_ attribute: WmcAttribute,
                          navigationPath: [WmcNavigatorManager.Path]?) {}

    /// 页面开始加载视图
    func viewDidLoad(_ attribute: WmcAttribute,
                     navigationPath: [WmcNavigatorManager.Path]?) {}
}
